package com.ithuaxin.array;

import java.util.Scanner;

public class Test13 {
    public static void main(String[] args) {
        int arr1[] = {12,14,23,45,66,68,70,77,90,91};
        int arr2[] = new int[arr1.length];
        int left = 0;
        int right = 0;

        for (int i = 0; i < arr1.length; i++) {
            if (arr1[i]%2==0){
                arr2[arr2.length-1-right] = arr1[i];
                right++;
            }
            else{
                arr2[left] = arr1[i];
                left++;
            }
        }

        for (int i = 0; i < arr2.length; i++) {
            System.out.print(arr2[i] + " ");
        }
    }
}
